//
//  SplashScreenViewController.m
//  Lottolandia
//
//  Created by Luca D'Antona on 24/11/13.
//  Copyright (c) 2013 Quelli for Lotto. All rights reserved.
//

#import "SplashScreenViewController.h"

@interface SplashScreenViewController ()

@end

@implementation SplashScreenViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)viewDidAppear:(BOOL)animated {
    [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(startAnimation) userInfo:nil repeats:NO];
}

-(void) startAnimation
{
    [UIView animateWithDuration:1.0 animations:^{
        self.splash.frame = CGRectMake(-7048/4-1200, -6536/4-200, 7048, 6536);
        self.splash.alpha = 0.0f;
    } completion:^(BOOL finished) {
        [self performSegueWithIdentifier:@"pushPark" sender:self];
    }];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
